package org.jsbd.boss.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.jsbd.boss.dao.IUpgradeApkDAO;
import org.jsbd.boss.domian.UpgradeApkBean;
import org.jsbd.boss.domian.channel.FileUploadVo;
import org.jsbd.boss.service.FileManager;
import org.jsbd.boss.service.IUpgradeApkService;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

@Service("upgradeApkService")
public class UpgradeApkServiceImpl implements IUpgradeApkService {
	
	@Resource
	private IUpgradeApkDAO upgradeApkDao;
	@Resource
	private FileManager fileManager;

	@Override
	public UpgradeApkBean getByMark(String mark) {
		return upgradeApkDao.selectByMark(mark);
	}

	@Override
	public FileUploadVo uploadApk(MultipartFile file) {
		FileUploadVo fileVo = fileManager.uploadUpgradeApk(file);
		return fileVo;
	}

	@Override
	public List<UpgradeApkBean> getAll() {
		return upgradeApkDao.selectAll();
	}

	@Override
	public void upgradeApk(UpgradeApkBean uab) {
		upgradeApkDao.upgradeApk(uab);
	}

	@Override
	public int deleteByMark(String mark) {
		return upgradeApkDao.deleteByMark(mark);
	}

}
